//
//  ST_BaseNetManager.h
//  ST_BaseMall
//
//  Created by 昱胜 on 2022/9/2.
//

#import <Foundation/Foundation.h>
#import "ST_BaseNetModel.h"
#import <QiniuSDK.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, HttpMethod) {
    HttpMethodGet = 0,
    HttpMethodPost,
    HttpMethodPut,
    HttpMethodDelete,
};

typedef void(^ST_DataRequestSuccess)(ST_BaseNetModel * __nullable responseObject);
typedef void(^ST_RequestFailure)(NSError * _Nullable error);
typedef void(^ST_QiniuRequestSuccess)(NSString *urlString);

@interface ST_BaseNetManager : NSObject

+ (ST_BaseNetManager *)shareManage;

@property (copy, nonatomic) ST_QiniuRequestSuccess qnSuccess;

+ (__kindof NSURLSessionTask *)requestMethod:(HttpMethod)method
                                   urlString:(NSString *)urlString
                                      params:(NSDictionary * _Nullable )params
                                        from:(BOOL)from
                                     success:(ST_DataRequestSuccess)success
                                     failure:(ST_RequestFailure)failure;

+ (__kindof NSURLSessionTask *)requestMethod:(HttpMethod)method
                                   urlString:(NSString *)urlString
                                      params:(NSDictionary * _Nullable )params
                                        from:(BOOL)from
                                       cache:(BOOL)cache
                                    showLoad:(BOOL)showLoad
                                   cacheData:(ST_DataRequestSuccess)cacheData
                                     success:(ST_DataRequestSuccess)success
                                     failure:(ST_RequestFailure)failure;


#pragma mark 七牛云上传
+ (void)uploadImageWithImageData:(UIImage *)image progress:(QNUpProgressHandler)progress complate:(ST_QiniuRequestSuccess)complate;

//上传多张图片
+ (void)uploadImages:(NSArray *)imageArray progress:(void (^)(CGFloat percent))progress complate:(ST_QiniuRequestSuccess)complate;


+ (NSString *)getClientInfo;
@end

NS_ASSUME_NONNULL_END
